home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
manyth31
/
manyth31.txt
< prev
next >
Wrap
Text File
|
1997-05-16
|
5KB
|
82 lines
ManyThings, 3.1 9-16-94
This program is for demo purposes only, I do not want you to send me any money. I just want
to share a program I had fun writing. The original program was fun for me in that it was
possible to do a windows 3.1 screen saver entirely in visual basic and windows calls without
additional DLLs required. This latest version of the program now uses a DLL written in
Borland C++ 3.1 to load DIB and GIF files into memory, do palette manipulations and write
DIB format files to disk. This became necessary because Visual Basic was too slow to
handle this.
Installation -- The program requires VBRUN300.DLL to be in your "\windows\system" directory
(can be downloaded from many places), and of course Windows 3.1. You need to copy
MANYTHNG.SCR (this is the executable) into your "\windows" directory and MNYTHDLL.DLL
into your "\windows\system" directory. At this point you can select "Control Panel" from
the "Main" group in program manager, and then from "Control Panel" select "Desktop". In
desktop there is a section called Screen Saver. In that section under name you then push
the down arrow and select "Many Things". At this point you sould probably click on the "Setup
Button", this is where you may set the various options and can set a password if you wish.
You may now test the saver by clicking "Test" and may set the time before windows will
activate the saver by changing the "Delay" time. When you select "OK" from desktop,
"Many Things" becomes the screen saver that windows will use.
Disclaimers: The program is provided as a programming example at no charge. The
program is provided as is, without any warranties or obligations.
Short History --
New with version 3.1 -- Fixes problem if bitmaps directory is invalid.
New with version 3.0 -- Now implementing password protection! There is also a new
ShootHoles saver, some minor changes of kaliedescope savers, and the line drawing color
selection has been improved for 256 color displays so that greys are rejected. Also,
it is now possible to change the frequency of individual savers, or even disabling
certain savers by adding lines to "Control.ini". Also there is a color cycling saver
that works with DIB and GIF-87a (non-interlaced) format files with both 256 color and
Hi-Color displays. The slide show routine now also works with GIF-87a (non-interlaced)
format files which are usually much smaller than BMP format files. These files may be
converted using Paintshop Pro (highly recommended shareware) make sure to select format
GIF and 87a -- non-interlaced. Warning -- interlaced GIF files will look like the picture
is stacked on itself several times and each version is squashed; GIF-89a files will not
load, they can be converted using Paintshop Pro. The C code for reading the GIF format
was written by Larry Widing and is available in the Borland C++ Win/OS2 Forum, Library
10 area on compuserve as bitmaps.zip.
This is a screen saver was originally written in visual basic 2.0 (standard edition) and
now has been upgraded to VB 3.0. The program actually cycles between several different
screen savers within the same program to give quite a bit of variety. The basic screen
saver method is based on an example in "Learn Programming and Visual Basic 2.0" by John
Socha and Sybex Inc. The Windows API calls were chosen with help from PC Mag's "Visual
Basic Programmer's Guide to the Windows API". The grabbing of the desktop pixels was
based on Jonathan Zuck's screen-capture utilities in the November issue of Windows
Tech Journal. Also thanks to Rick Perrott for suggestions on using setting a modal
window and disabling windows screen save (please send me a note on how to contact you).
Screen Saver Operation --
When the saver begin the subroutine main in MANYTHNG.BAS is first called, it then
reads CONTROL.INI and checks the command line parameters to see whether to run the
setup form or to start the saver. When it starts the saver, it executes ManyThngs.Show
which causes subroutine Form_Load to run in form MANYTHNG.FRM. This subroutine
initializes variables, etc. Then from that point on everything is initiated by the timer.
Whenever the timer times out, the subroutine Tick_Timer is called which handles the
housekeeping for which save is to be run, and when it is time to change to another saver.
Using the Tick_Timer means that the savers are limited for speed, but the will yield
time to background processes (e.g. file transfers, tape backups, etc.).
The savers that involve moving lines or objects work by starting at random positions on
the screen with zero velocity and acceleration vectors. Then in each iteration, a
random acceleration is added to the velocity of each point. When an object gets to the
edge of the screen the velocity's sign is reversed to bring it back into screen. This
effect looks to the user as if the object bounced off the edge of the screen. Also
when the velocity reaches a certain limit, the velocity is set to zero to prevent
things from getting too out of hand.
Bruce McLean
800 S. HW. 1417 #1214
Sherman TX 75090
CIS: 71413,2664
Internet: MCLB@TIMSG.CSC.TI.COM